#ifndef CARDMGR_H
#define CARDMGR_H

/**
* A class to interpret cards
* 
* @detailed A class to interpret cards implements a "standard" deck of 52 cards
*/
class CardMgr
{
	public:
		CardMgr();
		virtual ~CardMgr();

		/**
		* Returns the number of cards in the deck
		*
		* @return the number of cards in the deck
		*/
		virtual int32 getDeckSize();

		/**
		* Returns the suit of a card
		*
		* @param Card an ecoded card
		* @return the suit see: CardSuits
		*/
		virtual uint8 getSuit(uint8 Card);

		/**
		* Returns the rank of a card
		*
		* @param Card an ecoded card
		* @return the rank see: CardValues
		*/
		virtual uint8 getRank(uint8 Card);
		
		/**
		* Returns a card
		*
		* @param Index index into the deck
		* @return the encoded card
		*/
		virtual uint8 makeCard(int32 Index);
		
		/**
		* Encondes a card onto a buffer
		*
		* @param Card card to encode
		* @param Buf data buffer to encode to
		* @param Used amount used of the buffer
		*/
		virtual void encode(uint8 Card, uint8* Buf, int32* Used);

        // kharmon.  09-20-07.  #16842.
        virtual int32 decode(uint8 *pucSource, uint8 *pucCard);

	public:
		/**
		* Possible card suits
		*/
		enum CardSuits
		{
			CLUBS	 = 0x10,	/**< Clubs		*/
			DIAMONDS = 0x20,	/**< Diamonds	*/
			HEARTS	 = 0x30,	/**< Hearts		*/
			SPADES	 = 0x40		/**< Spades		*/
		};

		/**
		* Possible card ranks
		*
		* 2 - 10 face value
		*/
		enum CardValues
		{
			//
			// 2 - 10 face value
			//
			JACK  = 0x0b,		/**< Jack	*/
			QUEEN = 0x0c,		/**< Queen	*/
			KING  = 0x0d,		/**< King	*/
			ACE   = 0x0e		/**< Ace	*/
		};
};

inline
CardMgr::CardMgr()
{
}

inline
CardMgr::~CardMgr()
{
}

#endif
